//程序4-4
#include <stdio.h>

int main(void) {
    int i, n, sum;
    printf("请输入一个正整数：");
    scanf("%d", &n);
    sum = 0;

    for (i = 1; i <= n; i++) {
        sum = sum + i;
    }
    printf("%d\n", sum);
}
